{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>修改密码</title>
    <link rel="stylesheet" href="{% static 'layui.css' %}">
    <script src="{% static 'layui.js' %}"></script>
    <style>
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            font-family: 'Microsoft YaHei', sans-serif;
        }

        .login-container {
            background: white;
            padding: 40px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 450px;
            transition: transform 0.3s ease;
        }

        .login-container:hover {
            transform: translateY(-5px);
        }

        .layui-nav {
            background-color: #28a745 !important;
            padding: 15px 0;
            box-shadow: 0 2px 15px rgba(0,0,0,0.1);
        }

        .layui-nav-item a {
            color: white !important;
            font-weight: 500;
            transition: color 0.3s ease;
        }

        .layui-nav-item a:hover {
            color: #ffc107 !important;
        }

        .form-group {
            margin-bottom: 25px;
            position: relative;
        }

        input[type="text"],
        input[type="password"] {
            width: 100%;
            padding: 12px 40px 12px 15px;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease;
        }

        input:focus {
            outline: none;
            border-color: #28a745;
            box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
        }

        button {
            width: 100%;
            padding: 15px;
            background-color: #28a745;
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.2s ease;
        }

        button:hover {
            background-color: #218838;
            transform: scale(1.02);
        }

        .form-tip {
            text-align: center;
            color: #666;
            margin-top: 15px;
            font-size: 14px;
        }

        .brand-logo {
            text-align: center;
            margin-bottom: 30px;
        }

        .brand-logo img {
            width: 80px;
            animation: spin 5s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
    </style>
</head>
<body>


<div class="login-container">
<div class="form-tip" style="text-align: center; margin-bottom: 20px;">
    {% if error %}
{#        alert(1)#}
    <script>
        layui.use('layer', function(){
            layer.alert('{{ error }}', {
                title: '提示',
                icon: 2,  // 红色警告图标
                btn: ['确定'],
                anim: 6  // 动画效果
            });
        });
    </script>
    {% endif %}
</div>

<!-- 修改后的表单结构 -->
<form method="post" action="{% url 'up' %}" class="layui-form">
    {% csrf_token %}
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input type="text" name="username" required lay-verify="required"
                   placeholder="请输入用户名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="password" name="password" required lay-verify="required"
                   placeholder="请输入新密码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn layui-btn-normal">立即修改密码</button>
        </div>
    </div>
</form>
</div>

<script src="{% static 'layui/layui.js' %}"></script>


</body>

</html>
